Helpful Information
 
 
Category: Help with MySQL
Help with MySQL > PHP > Flash

Hello,

I have a PHP script that interfaces a MySQL database and returns data to a Flash movie. Everything is working as intended except one thing. I have a text field that stores a character A-D, the character is passed through to the Flash movie but my code in the movie to identify the character is not working.

The field displays an "A" but when I try to do anything with the "A", it fails. I have tried using the trim function but my if statement still fails every time. This also fails in the PHP script when I test it there.

I have tried changing the field type and corresponding character to integer and others without luck as well.

Does MySql append any data that is unseen to me? What could the problem be?I'm a noob with all three technologies, so please be gentle in your explanation.

Thanks for your help.

PHP code

// Send data to the Flash movie
echo "&number_s= $number";
echo "&reference_s= $reference";
echo "&question_s= $question";
echo "&response_1_s= $response_1";
echo "&response_2_s= $response_2";
echo "&response_3_s= $response_3";
echo "&response_4_s= $response_4";
echo "&answer_s= $answer";

Flash Code

loadVariables("exam.php",'POST');

The echo itself has spaces between the identifier and value (I assume that $number, $question, etc all have representing variables).
That should be:


echo "&number_s=$number"; // no space between the = and the $number.

Another option is to use an array with key => value pairs and look at using the http_build_query function to construct this for you.

Thanks for response. I fixed that and still have no joy. The php works as the fields are sent to flash. I think my problem lies there. :thumbsup:










privacy (GDPR)